from p06_storing_thread_specific_state import LazyConnection
import threading

def test(conn, data):
    with conn as s:
        s.send(data.to_bytes(16, 'little'))

conn = LazyConnection(('localhost', 20001))

nsenders = 1024
for n in range(nsenders):
        t = threading.Thread(target=test, args=(conn, n,))
        t.start()
         
